package cn.iocoder.yudao.module.cmt.dal.mysql.course;

import java.util.*;
import cn.iocoder.yudao.framework.common.pojo.PageResult;
import cn.iocoder.yudao.framework.mybatis.core.query.LambdaQueryWrapperX;
import cn.iocoder.yudao.framework.mybatis.core.mapper.BaseMapperX;
import cn.iocoder.yudao.module.cmt.dal.dataobject.course.CourseChapterDO;
import org.apache.ibatis.annotations.Mapper;
import cn.iocoder.yudao.module.cmt.controller.admin.course.vo.*;

@Mapper
public interface CourseChapterMapper extends BaseMapperX<CourseChapterDO> {

    default PageResult<CourseChapterDO> selectPage(CourseChapterPageReqVO reqVO) {
        return selectPage(reqVO, new LambdaQueryWrapperX<CourseChapterDO>()
                .betweenIfPresent(CourseChapterDO::getCreateTime, reqVO.getCreateTime())
                .orderByDesc(CourseChapterDO::getId));
    }

}
